<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>长胜平台</title>
    <!--<link rel="stylesheet" href="__CSS__/mui.min.css"/>-->
    <link rel="stylesheet" href="__CSS__/style.css?t=1">
    <link rel="stylesheet" href="__CSS__/login.css">

</head>

<body>
<div class="title_div">
    <h1>长胜平台</h1>
</div>
<div class="logo">
    <img src="__IMGS__/logo.jpg"/>

</div>
<form action="#" id="form1" onsubmit="return false" method="POST">
    <div class="login_div">

        <div class="mui-input-row">
            <label>账号</label>
            <input type="text" name="user_name" class="mui-input-clear" placeholder="请输入会员账号">
        </div>
        <div class="mui-input-row">
            <label>密码</label>
            <input type="password" name="password" class="mui-input-password" placeholder="请输入密码">
        </div>
        <div class="mui-input-info">
            <p>用户名或密码错误!</p>

        </div>
        <div class="mui-button-row">
            <button type="button" id="login_but" class="mui-btn mui-btn-primary">登陆</button>
        </div>
    </div>
</form>
<script type="text/javascript" src="__JS__/jquery-1.4.min.js"></script>
<script src="__JS__/mui.min.js"></script>
</body>
<script>
    mui.init({
        swipeBack: true //启用右滑关闭功能
    });
    var info = document.getElementById("login_but");
    document.getElementById("login_but").addEventListener('tap', function () {
        mui.ajax({
            //几个参数需要注意一下
            type: "POST",//方法类型
            dataType: "json",//预期服务器返回的数据类型
            url: "{:url('/index/Home/login',[],true,true)}",//url
            data: $('#form1').serialize(),
            success: function (result) {
                console.log(result);//打印服务端返回的数据(调试用)
                if (result.code == 0) {
                    mui.alert(result.msg);
                }
                if (result.code == 1) {
                    window.location.href = result.url;
                }
            },
            error: function () {
                mui.alert('登录异常！');
                //alert("异常！");
            }
        });
    });
</script>
</html>
